module(
    name = "rules_go",
    repo_name = "io_bazel_rules_go",
    version = "0.34.0",
    compatibility_level = 0,
)

print("WARNING: The rules_go Bazel module is still highly experimental and subject to change at any time. Only use it to try out bzlmod for now.")

bazel_dep(name = "bazel_skylib", version = "1.2.0")
bazel_dep(name = "platforms", version = "0.0.4")
bazel_dep(name = "rules_proto", version = "4.0.0")
bazel_dep(name = "protobuf", version = "3.19.2", repo_name = "com_google_protobuf")

non_module_dependencies = use_extension("//go/private:extensions.bzl", "non_module_dependencies")
use_repo(
    non_module_dependencies,
    "io_bazel_rules_nogo",
)

go_sdk = use_extension("//go:extensions.bzl", "go_sdk")
go_sdk.download(name = "go_default_sdk", version = "1.18.3")
use_repo(go_sdk, "go_default_sdk")
register_toolchains("@go_default_sdk//:all")

bazel_dep(name = "gazelle", version = "0.26.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")
use_repo(go_deps,
    "com_github_golang_mock",
    "com_github_golang_protobuf",
    "org_golang_google_protobuf",
)
